package com.luoqian.demo03;

import com.luoqian.demo02.User;

/**
 * 得到class对象的4中方法
 */
public class GetClass_Way {
    public static void main(String[] args) throws Exception {
        Class<? extends User> clazz1 = new User().getClass();
        Class<?> clazz2 = Class.forName("com.luoqian.demo02.User");
        Class<User> clazz3 = User.class;
        Class<?> clazz4 = GetClass_Way.class.getClassLoader().loadClass("com.luoqian.demo02.User");
        System.out.println(clazz1);
        System.out.println(clazz2);
        System.out.println(clazz3);
        System.out.println(clazz4);


    }
}
